home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / AIIc / TN.AIIC.001 next >
Encoding:
Text File  |  1990-01-23  |  4.7 KB  |  86 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. Apple IIc
  8. #1:    Mouse Differences on IIe and IIc
  9.  
  10. Revised by:    Matt Deatherage                                  November 1988
  11. Revised by:    Cameron Birse                                    February 1986
  12.  
  13. This Technical Note explains differences between the IIe and IIc when working 
  14. with a mouse and how to write programs which function properly on both 
  15. machines.
  16. _____________________________________________________________________________
  17.  
  18. If you use the mouse firmware routines (i.e., SetMouse) to control the mouse, 
  19. then these routines will perform the same function on the IIc as they do on 
  20. the IIe.  However, a program which uses the mouse may not behave the same on 
  21. both computers, and there are two reasons for the possible differences.
  22.  
  23. If a program does not properly set the environment prior to calling the mouse 
  24. firmware routines, it is possible for a program to work on one machine and not 
  25. the other.  In addition, there are differences in machines and although the 
  26. ROM routines perform the same functions, there may be a noticeable difference 
  27. in the mouse behavior between the two machines.
  28.  
  29. This Note explains the fundamental differences between the way the mouse works 
  30. on the two machines.  We point out precautions that you need to take to ensure 
  31. your assembly language programs work properly on both machines.  (With the 
  32. exception of mouse movement scaling described below, neither BASIC nor Pascal 
  33. programs need be concerned with setting the proper environment.)
  34.  
  35. The Apple IIe mouse card has a microprocessor on it which constantly polls the 
  36. mouse to get status and position information.  This data is kept on the card 
  37. and is available whenever the program requests it through the ReadMouse 
  38. routine.  If the mouse is in passive mode, this information will be picked up 
  39. by the main program  whenever it gets around to it.
  40.  
  41. The SetMouse routine can set the mouse card to issue interrupts under certain 
  42. conditions.  When the mouse card determines that such conditions exist, it 
  43. issues an interrupt.  This interrupt stops the main computer and goes to 
  44. whatever interrupt handling routine has been prepared.  This routine then 
  45. reads the information from where the card processor saved it and puts it in 
  46. the screen holes.  When using a mouse on an Apple with a mouse card, your 
  47. program is only interrupted if you have requested it, and the data in the 
  48. screen holes is changed only when the program's interrupt handler or polling 
  49. routine calls ReadMouse.  In addition, enabling and disabling interrupts does 
  50. not affect the card's microprocessor from updating the mouse information.
  51.  
  52. The Apple IIc mouse does not have a card microprocessor, so mouse information 
  53. is collected by interrupting the microprocessor of the IIc itself.  When the 
  54. interrupt occurs, the firmware captures it and processes it, which includes 
  55. updating the screen holes.  The interrupt is passed only if SetMouse set up 
  56. the conditions to do so.
  57.  
  58. Having the mouse interrupt the computer's microprocessor also means that your 
  59. program is being constantly interrupted, which affects program timing.  This 
  60. interruption also means that the screen holes are constantly updated with X 
  61. and Y information, even in passive mode, since this information must be stored 
  62. somewhere and there is no card to keep it in.  If you have disabled 
  63. interrupts, the mouse can never interrupt the microprocessor, so the X and Y 
  64. values are never updated and calling ReadMouse will indicate that there has 
  65. been no mouse movement.
  66.  
  67. Since the Apple IIc is constantly interrupted while the mouse is on, the 
  68. program's performance may be affected.  To minimize this effect, the IIc 
  69. responds one-half as frequently to mouse movements as does the mouse card, 
  70. which means the mouse must be moved twice as far to create the same on-screen 
  71. effect.  If you want the same behavior on both machines, multiply the IIc X 
  72. and Y values by two and the clamping value by one half.  You do not need to 
  73. make any changes to these values if your program is running on a IIe.
  74.  
  75. With this exception for mouse movement, your assembly language program can 
  76. ignore which machine it is running on by following the precautions listed in 
  77. Mouse Technical Note #1, Interrupt Environment with the Mouse (you must take 
  78. these conditions into account if you want your assembly language program to 
  79. behave similarly on both machines).  If you are working in BASIC or Pascal, 
  80. these conditions are already handled for you.
  81.  
  82.  
  83. Further Reference
  84. o    Apple IIc Technical Reference Manual, Second Edition
  85. o    Mouse Technical Note #1, Interrupt Environment with the Mouse
  86.